feat(vscode): regenerate local.settings.json, host.json, and workflow-designtime for source-controlled Logic App projects#9377
Merged
lambrianmsft merged 19 commits intoJul 11, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds “self-healing” for source-controlled Logic App projects in the VS Code designer by validating and regenerating git-ignored/missing artifacts needed to start the design-time API (project-root local.settings.json, project-root host.json when invalid/missing, and the workflow-designtime/ baseline).
Changes:
- Added
validateProjectArtifacts.tshelpers to validate/regenerate roothost.json, rootlocal.settings.json(including referenced@appsetting(...)keys), andworkflow-designtime/contents. - Wired artifact validation/regeneration into
startDesignTimeApiand activation (promptStartDesignTimeOption) with additional diagnostic logging. - Added/updated unit tests to lock down expected artifact content and regeneration behavior.
Reviewed changes
Copilot reviewed 13 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/vscode-extension/src/graphify-out/GRAPH_REPORT.md | Regenerated Graphify report output. |
| libs/data-mapper-v2/src/graphify-out/GRAPH_REPORT.md | Regenerated Graphify report output. |
| libs/chatbot/src/graphify-out/graph.json | Regenerated Graphify graph JSON output. |
| libs/chatbot/src/graphify-out/GRAPH_REPORT.md | Regenerated Graphify report output. |
| libs/a2a-core/src/graphify-out/GRAPH_REPORT.md | Regenerated Graphify report output. |
| apps/vs-code-designer/src/app/utils/codeless/validateProjectArtifacts.ts | New artifact validation/regeneration implementation. |
| apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts | Uses the new orchestrator for design-time startup + activation-time regeneration. |
| apps/vs-code-designer/src/app/utils/codeless/test/validateProjectArtifacts.test.ts | New unit tests covering regeneration + golden content assertions. |
| apps/vs-code-designer/src/app/utils/codeless/test/startDesignTimeApi.test.ts | Updated tests for startup + added activation wiring tests. |
| apps/vs-code-designer/src/app/utils/appSettings/localSettings.ts | Adjusted schema generation (including key ordering and codeful flag). |
| apps/vs-code-designer/src/app/utils/appSettings/test/localSettings.test.ts | Added golden tests + key-order characterization coverage. |
| apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/test/CreateLogicAppWorkspace.test.ts | Expanded coverage for codeful local.settings.json creation expectations. |
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
✅ Contributors
✅ Screenshots/Videos
Summary Table
This PR passes. The submitted risk level matches the diff-based advised risk level, so no escalation is needed.Last updated: Fri, 10 Jul 2026 23:45:21 GMT |
…t for logic app types Add golden/characterization coverage that pins the exact content of the project-root and workflow-designtime local.settings.json schemas (getLocalSettingsSchema) across the codeless/codeful axis, plus the codeful creation path in CreateLogicAppWorkspace. Expected values are reconstructed from the shared key/value constants so structural regressions are caught while staying in sync with the codebase. These tests exercise pre-existing behavior (source unchanged from main) and lock it in before the regeneration feature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…for source-controlled projects
When source control is enabled, the project-root local.settings.json and the
workflow-designtime folder are gitignored, so a fresh clone lacks them and the
design-time host cannot start. Add validateProjectArtifacts to detect and
regenerate these artifacts:
- Scan connections.json, parameters.json and workflows for @appsetting('X')
references and ensure the root local.settings.json has the baseline schema
plus placeholder entries for every referenced key (never overwriting values).
- Validate the workflow-designtime folder (host.json + local.settings.json) and
regenerate it when missing or invalid.
Wired into startDesignTimeApi so artifacts are validated/regenerated before the
host launches. Covered by validateProjectArtifacts.test.ts (incl. golden content
by logic app type, reconstructed from shared constants) and updated
startDesignTimeApi tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…h creation path getLocalSettingsSchema built the root (non-design-time) Values in a different key order than CreateLogicAppWorkspace.createLocalConfigurationFiles, so a regenerated local.settings.json was key-for-key reordered versus a freshly created project (e.g. APP_KIND/FUNCTIONS_WORKER_RUNTIME first instead of AzureWebJobsStorage first). Reorder the root branch to mirror the creation path (AzureWebJobsStorage, FUNCTIONS_INPROC_NET8_ENABLED, FUNCTIONS_WORKER_RUNTIME, APP_KIND, ProjectDirectoryPath, [WORKFLOW_CODEFUL_ENABLED]); design-time order is unchanged. Add key-order regression tests (toEqual ignores property order). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…esign-time dir Add a regression test for the codeful branch where workflow-designtime already exists but its host.json and local.settings.json are invalid (wrong bundle id / missing required keys). Verifies both artifacts are rewritten to the codeful baseline (host.json + local.settings.json incl. WORKFLOW_CODEFUL_ENABLED), closing the gap where only the missing-directory codeful path was covered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d projects The regeneration feature restored the root local.settings.json and the workflow-designtime folder, but never regenerated the project-level host.json. When source control strips this git-ignored file from a fresh clone the function host cannot start. Add regenerateRootHostFile (mirroring the workspace creation path host.json content) and wire it into validateAndRegenerateProjectArtifacts and promptStartDesignTimeOption. Rename isDesignTimeHostFileValid to isHostFileValid since it now validates both the root and design-time host.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds output-channel logging at every decision point in the host.json / local.settings.json regeneration flow: which files are checked and whether they exist, whether each file was regenerated or preserved, and how many logic app folders were detected. Crucially logs when zero logic app folders are detected, which happens when host.json is missing (a folder is only recognized as a logic app when host.json exists), explaining why regeneration appears to do nothing in that case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r, design-time settings validation, and promptStartDesignTimeOption regeneration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…er logic app type Locks current regenerateLocalSettings output for logicApp/customCode/rulesEngine/codeful before refactoring. Documents the known gaps (customCode/rulesEngine undetected at regen time; codeful missing AzureWebJobsFeatureFlags) so upcoming fixes surface as intentional test diffs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion and regeneration Extract getRootLocalSettings(logicAppFolderPath, logicAppType) as the single source of truth for the project-root local.settings.json. Both createLocalConfigurationFiles (fresh project creation) and regenerateLocalSettings (source-control regeneration) now build the file from it, so a regenerated file is key-for-key identical to a freshly created project of the same type. Regeneration already detects codeful via isCodefulProject, so codeful projects now regenerate with AzureWebJobsFeatureFlags in addition to WORKFLOW_CODEFUL_ENABLED, matching fresh creation. Also drops AzureFunctionsJobHost__extensionBundle__id from the codeful creation path per review feedback (codeful bundle id is not yet published). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ettings Add detectLogicAppProjectType, which infers a source-controlled project's ProjectType from its files: codeful via isCodefulProject, and customCode/rulesEngine via a sibling custom-code functions (.csproj) project in the workspace root. regenerateLocalSettings now uses it so customCode and rulesEngine projects regenerate with AzureWebJobsFeatureFlags=EnableMultiLanguageWorker, matching what fresh creation would produce (previously they were treated as plain codeless). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…gn-time discovery mode isHostFileValid now requires a non-empty extensionBundle.version, and for the design-time host.json additionally requires the workflow operation discovery host mode setting. Extract the setting key into a shared constant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… directory ensureDesignTimeDirectory previously used projectPath.includes(designTimeDirectoryName), which false-positives on siblings such as workflow-designtime-backup. Match on a full path segment instead so a backup folder gets a nested workflow-designtime directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eneration Trim inline comments that restated the validateAndRegenerateProjectArtifacts, regenerateRootHostFile and regenerateLocalSettings docstrings, and remove a duplicated golden-test comment line. No behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rebase onto main picked up upstream's renames of the codeful constant (workflowCodefulEnabled -> workflowCodefulEnabledKey) and SDK-detection helper (isCodefulProject -> hasCodefulSdkReference). Update the artifact regeneration module and its tests to use the current symbol names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
91e4b3a to
1f87218
Compare
Consolidate the two local.settings.json builders into a single ProjectType-aware function. getLocalSettingsSchema's third parameter changes from an isCodeful boolean to a ProjectType, so the root branch now emits the multi-language worker feature flag for non-plain types (matching the creation path) instead of only WORKFLOW_CODEFUL_ENABLED. Creation, design-time API startup, and regeneration all route through the one function so the files cannot drift apart. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
isLogicAppProject now keys off the workflow-folder signal (codeless workflow.json with a Microsoft.Logic schema, codeful workflow.cs at the project root, or the isCodeful workspace setting) instead of requiring host.json to exist and parse. host.json is a generic Azure Functions artifact and is commonly gitignored under source control, so a fresh clone can be missing or have a corrupted host.json yet still be a valid logic app project. Keying off the workflow signal lets the extension detect such projects and heal/regenerate host.json, local.settings.json, and workflow-designtime before starting. Also fixes codeful detection to look for workflow.cs at the project root rather than in subfolders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…roj SDK reference isLogicAppProject now recognizes a codeful project through hasCodefulSdkReference (a .NET 8 .csproj referencing Microsoft.Azure.Workflows.Sdk) instead of a hardcoded workflow.cs filename, so codeful workflows whose C# file is named anything are still recognized. Adds a statSync default to the fs-extra test mock and unit tests covering filename-independent codeful detection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…pProject The WORKFLOW_CODEFUL_ENABLED workspace setting lives in the gitignored local.settings.json and adds no detection value alongside the authoritative .csproj SDK-reference check, so isLogicAppProject no longer consults it. The isCodeful UI context is now driven by the structural .csproj signal, which also works for source-controlled projects missing local.settings.json. Adds a test asserting a folder with only the setting (no .csproj) is not tagged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Renames the golden-content test suites and their baseline objects (goldenHostJson/goldenRootHostJson -> expectedHostJson/expectedRootHostJson, 'golden ... content by logic app type' -> 'expected ... content by logic app type') so the intent reads clearly without the golden-test jargon. No behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ccastrotrejo
approved these changes
Jul 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Type
Risk Level
What & Why
TL;DR: When a Logic App project has source control enabled, the git-ignored artifacts — the project-root
local.settings.jsonand theworkflow-designtime/folder (and, when missing, the roothost.json) — are absent on a fresh clone, leaving the project in an invalid state that can't start the design-time API.This PR detects those missing/invalid artifacts and regenerates them from the existing project inputs (the logic app,
parameters.json, andconnections.json) so the project becomes valid again without manual setup. Regeneration is idempotent: valid existing files are preserved and only missing/invalid ones are rewritten. It covers both codeless and codeful logic app types, aligns the regenerated rootlocal.settings.jsonkey order with the creation path, and validates theworkflow-designtimecontents (regenerating when required keys are missing or empty). Diagnostic logging was added at each decision point to make regeneration behavior observable in the output channel.Impact of Change
local.settings.json/workflow-designtime(and roothost.json) now self-heal on activation/design-time start, so the project is valid and the designer works without manual regeneration.validateProjectArtifacts.ts(regenerateLocalSettings,regenerateRootHostFile,regenerateDesignTimeDirectory,validateDesignTimeDirectory,validateAndRegenerateProjectArtifacts) wired intostartDesignTimeApi/promptStartDesignTimeOption. Regeneration reuses the same content baselines as the workspace creation path.Test Plan
Unit tests (
apps/vs-code-designer, Vitest):validateProjectArtifacts.test.ts— 27 tests. Characterizes the exact content of root and design-timelocal.settings.jsonandhost.jsonfor both codeless and codeful logic apps (locking pre-change behavior against regression), plus coversvalidateDesignTimeDirectoryinvalid-settings cases and thevalidateAndRegenerateProjectArtifactsorchestrator (all-missing regenerates all three artifacts; all-valid writes nothing; only-root-host-missing regenerates just roothost.json).startDesignTimeApi.test.ts— 18 tests, including thepromptStartDesignTimeOptionactivation wiring (regenerates per detected folder; logs and skips when no logic app folders / no workspace folders).Manual testing: Verified on a source-controlled project with
local.settings.json,workflow-designtime/, and roothost.jsonremoved — all regenerated with correct content and stable key order on design-time start. Also verified connection-key regeneration produces valid keys.Contributors
Screenshots/Videos
Not applicable — no visual/UI changes. This is an activation-path artifact-regeneration change with unit coverage in
apps/vs-code-designer/src/app/utils/codeless/__test__/.